<div class="border">
  <div class="header">
    <span>播发请求</span>
  </div>
  <div class="content" *ngIf="view!='teminal'">
    <md-grid-list cols="2" rowHeight="100px" class="common">
      <md-grid-tile [colspan]="1" [rowspan]="1">
        <md-form-field class="half">
          <input name="title" mdInput value="" placeholder="播发标题" [(ngModel)]="playRequest.MsgTitle">
        </md-form-field>
      </md-grid-tile>
      <md-grid-tile [colspan]="1" [rowspan]="1">
        <md-form-field class="half">
          <textarea name="content" mdInput #message maxlength="256" placeholder="播发内容" [(ngModel)]="playRequest.MsgDesc"></textarea>
          <md-hint align="end">{{message.value.length}} / 256</md-hint>
        </md-form-field>
      </md-grid-tile>

    </md-grid-list>


    <md-grid-list cols="2" rowHeight="100px" class="common">
      <md-grid-tile [colspan]="1" [rowspan]="1">
        <input class="half" type="file" name="fmusic" id="fmusic" accept="audio/mpeg" (change)="fileChange($event)">
      </md-grid-tile>
      <md-grid-tile [colspan]="1" [rowspan]="1">
        <md-form-field class="half">
          <textarea name="content" mdInput #message maxlength="256" placeholder="覆盖区域" [(ngModel)]="playRequest.AreaCode"></textarea>
        </md-form-field>
      </md-grid-tile>
    </md-grid-list>



    <md-grid-list cols="2" rowHeight="100px" class="common">
      <md-grid-tile [colspan]="1" [rowspan]="1">
        <div class="half">
          <div>开始时间</div>
          <div style="display:flex">
            <md-form-field>
              <input mdInput [mdDatepicker]="picker" [(ngModel)] = 'playRequest.beginDate'>
              <md-datepicker-toggle mdSuffix [for]="picker"></md-datepicker-toggle>
              <md-datepicker #picker></md-datepicker>
            </md-form-field>
            <div class='time'>
              <md-input-container class='inputTime'>
                <input mdInput type="number" max='23' min='00' name="beginHour" [(ngModel)]="playRequest.beginHour" />
              </md-input-container>
              <span class="mid"> : </span>
              <md-input-container class='inputTime'>
                <input mdInput type="number" max='59' min='00' name="beginMin" [(ngModel)]="playRequest.beginMin" />
              </md-input-container>
              <span class="mid"> : </span>
              <md-input-container class='inputTime'>
                <input mdInput type="number" max='59' min='00' name="beginSec" [(ngModel)]="playRequest.beginSec" />
              </md-input-container>
            </div>
          </div>
        </div>
      </md-grid-tile>
      <md-grid-tile [colspan]="1" [rowspan]="1">
        <div class="half">
          <div>结束时间</div>
          <div style="display:flex">
            <md-form-field>
              <input mdInput [mdDatepicker]="picker1" [(ngModel)] = 'playRequest.endDate'>
              <md-datepicker-toggle mdSuffix [for]="picker1"></md-datepicker-toggle>
              <md-datepicker #picker1></md-datepicker>
            </md-form-field>
            <div class='time'>
              <md-input-container class='inputTime'>
                <input mdInput type="number" max='23' min='00' name="endSec" [(ngModel)]="playRequest.endHour" />
              </md-input-container>
              <span class="mid"> : </span>
              <md-input-container class='inputTime'>
                <input mdInput type="number" max='59' min='00' name="endSec" [(ngModel)]="playRequest.endMin" />
              </md-input-container>
              <span class="mid"> : </span>
              <md-input-container class='inputTime'>
                <input mdInput type="number" max='59' min='00' name="endSec" [(ngModel)]="playRequest.endSec" />
              </md-input-container>
            </div>
          </div>
        </div>
      </md-grid-tile>
    </md-grid-list>



    <md-grid-list cols="2" rowHeight="100px" class="common">
      <md-grid-tile [colspan]="1" [rowspan]="1">
        <md-form-field class="half">
          <input name="title" mdInput value="" placeholder="事件类型" [(ngModel)]="playRequest.EventType">
        </md-form-field>
      </md-grid-tile>
      <md-grid-tile [colspan]="1" [rowspan]="1">
        <!-- <md-form-field class="half"> -->
          <!-- <input name="title" type="number" mdInput value="" placeholder="事件级别" [(ngModel)]="playRequest.Severity"> -->
          <md-select class="half" placeholder="事件级别" [(ngModel)]="playRequest.Severity">
            <md-option *ngFor="let event of eventLevels, let i = index" [value] = i>
              {{event}}
            </md-option>
          </md-select>
        <!-- </md-form-field> -->
      </md-grid-tile>
    </md-grid-list>

    <button md-raised-button color="primary" class="send-btn" (click)="sendplayRequest()">播发</button>
  </div>


</div>
